---
title: "SQL-008: Retrieve distinct policy name list"
summary: Retrieve the distinct policy number/name list for attorney-assignment maintenance.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
---

# SQL-008 Retrieve distinct policy name list

Retrieves a distinct list of `POLICY` numbers and names, ordered by description, for the `POLICYNAMESQL` code-table lookup used by the attorney-assignment maintenance UI.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-008 |
| **Operation type** | Read |
| **Execution method** | Inline SQL (`clsCodeCollection.GetCodeCollection`) |
| **Database** | Oracle |
| **Command type** | Text |
| **Business object** | N/A (Application layer) |
| **Criteria property** | N/A (Application layer) |
| **Lifecycle method** | N/A (Application layer) |
| **Application class** | `clsAttorneyTableManager` |

## Parameters

No runtime parameters — this is a static code-table lookup constant (`POLICYNAMESQL`), executed as-is via `clsCodeCollection.GetCodeCollection(DPI, POLICYNAMESQL)`.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [POLICY](../database-tables.md#policy) | SELECT | `POLICY_NUM`, `POLICY_NAME` |

## Sample SQL

```sql
SELECT DISTINCT
  to_char(POLICY_NUM) As code,
  POLICY_NAME As code_descr
FROM POLICY
ORDER BY code_descr
```

## Sources
- `SAIF.Application.Claim.Legal\clsAttorneyTableManager.vb`
